<template>
	<div class="num-container">
		<span class="num-minus" :class="{disabled:num == min}" @click="minus"></span>
		<span class="num">{{num}}</span>
		<span class="num-add" :class="{disabled:num == max}" @click="add"></span>
	</div>
</template>
<script>
export default{
	name:'NumEditor',
	methods:{
		minus(){
			if(this.num == this.min) return;
			this.$emit('numMinus');
		},
		add(){
			if(this.num == this.max) return;
			this.$emit('numAdd');
		}
	},
	props:['num','min','max']
}
</script>
<style lang='less' scoped>
.num-minus,.num,.num-add{
	width: .86rem;
	height: .74rem;
	display: inline-block;
	background-color: #f5f5f5;
	border-radius: 2px;
	text-align: center;
	line-height: .74rem;
	font-size: .37rem;
	margin-right: .053rem;
	background-repeat: no-repeat;
	background-position: center;
	vertical-align: middle;
}
.num-minus{
	background-image: url(../assets/img/common/minus.png);
}
.num-add{
	background-image: url(../assets/img/common/add.png);
}
</style>